Skip to content

feat(serve): node name, LAN IP hints, and token URL auto-login#86

Merged
RealZST merged 2 commits into
mainfrom
feat/serve-node-identity
Jun 16, 2026
Merged

feat(serve): node name, LAN IP hints, and token URL auto-login#86
RealZST merged 2 commits into
mainfrom
feat/serve-node-identity

Conversation

@RealZST

@RealZST RealZST commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

Improves the hk serve web-mode experience when working with remote or multiple nodes.

  • Node name β€” hk serve --name <label> (defaults to the machine hostname), exposed via a new GET /api/server_info and shown in the sidebar and the browser tab title. When several browser tabs each point at a different machine, you can tell them apart at a glance.
  • LAN access β€” when bound to 0.0.0.0, print the machine's actual LAN IP(s) instead of the unreachable 0.0.0.0 address.
  • Token auto-login β€” embed the access token in the printed URL (?token=…); the frontend reads it on load, stores it, then strips it from the address bar via replaceState (the same pattern Jupyter uses). Previously a non-localhost bind required a token but the web UI had no way to supply one.

Relates to #39

#39 raises the cross-device case: managing agents on several machines means juggling browser tabs and wanting an "ζ‰€ε±žδΈ»ζœΊ" (host) label to know which machine is which. This adds that per-node label (sidebar + tab title) so multiple tabs are easy to distinguish. The broader aggregation dashboard and cross-host deploy from #39 are out of scope here.

Testing

  • Rust β€” server_info endpoint test; full hk-web suite green.
  • Frontend β€” vitest for consumeUrlToken (store + strip + preserve other params); tsc and biome clean.
  • Manual (macOS) β€” --host 0.0.0.0 prints real LAN IPs + a ?token= URL; opening it auto-logs-in and the token disappears from the address bar; sidebar and tab title show the node name; clearing the token yields 401s.

πŸ€– Generated with Claude Code

RealZST and others added 2 commits June 17, 2026 00:48
Make remote `hk serve` usable across multiple nodes:

- Node identity: `hk serve --name <label>` (defaults to hostname) is
  exposed via a new `GET /api/server_info` endpoint and shown in the web
  sidebar and browser tab title, so tabs pointing at different remote
  nodes are distinguishable.
- LAN access: when bound to 0.0.0.0, print the machine's actual LAN IPs
  instead of the unreachable 0.0.0.0 address.
- Token auto-login: embed the access token in the printed URL
  (`?token=…`); the frontend consumes it on load, stores it, then strips
  it from the address bar via replaceState. Mirrors Jupyter's flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@RealZST RealZST merged commit bb55d2e into main Jun 16, 2026
3 checks passed
@RealZST RealZST deleted the feat/serve-node-identity branch June 16, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant